package com.hand.wfive.util.click;

/**
 * 防止按钮多次点击
 */
public class NoFastClickUtils {

    // 时间间隔
    private static final int spaceTime = 200;
    // 上次点击的时间
    private static long lastClickTime = 0;

    public static boolean isFastClick() {
        // 当前系统时间
        long currentTime = System.currentTimeMillis();
        // 是否允许点击
        boolean isAllowClick = currentTime - lastClickTime <= spaceTime;
        lastClickTime = currentTime;
        return isAllowClick;
    }
}